package com.ximu.banner.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximu.banner.entity.Banner;
import com.ximu.banner.mapper.BannerMapper;
import com.ximu.common_utlis.jwt.JwtUtil;
import com.ximu.common_utlis.result.Result;
import com.ximu.coupon.entity.Coupon;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ximu
 * @since 2023-03-21
 */
@RestController
@RequestMapping("/banner")
@Api(tags = "轮播图接口")
public class BannerController {

    @Autowired
    private BannerMapper bannerMapper;

    @ApiOperation(value = "查询轮播图")
    @PostMapping("findAllBanner")
    public Result findAllCars(){
        try {
            List<Banner> banners = bannerMapper.selectList(null);
            return Result.ok().data("banners",banners).message("成功");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return Result.error().message("查询失败");
    }

}

